package com.loubobooo.personal.blog.service;

import com.loubobooo.personal.blog.entity.Article;
import com.loubobooo.personal.blog.entity.vo.ArticleVO;
import com.loubobooo.personal.blog.entity.vo.ArticleDetailVo;
import com.loubobooo.personal.blog.entity.vo.ArticleListVo;
import com.loubobooo.personal.blog.entity.vo.ArticleSearchVo;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface ArticleService {
	//获取文章总数
	public Integer countArticle(Integer status);
	
	//获取评论总数
	public Integer countArticleComment(Integer status);
	
	//获得浏览量总数
	public Integer countArticleView(Integer status);
	
	//获得所有文章不分页
	public List<ArticleListVo> listArticle(Integer status);
	
	//根据id获得文章
	public ArticleVO getArticleById(Integer status, Integer id);

	//修改文章信息
	public void updateArticle(Integer id, Article article);

	//批量删除文章
	public void deleteArticleBatch(Integer[] ids);

	//删除文章
	public void deleteArticle(Integer id);

	//分页显示()
	public List<ArticleListVo> listArticleByPage(Integer status, Integer pageNo, Integer pageSize);
	
	//文章详情页面显示
	public ArticleDetailVo getArticleDetailById(Integer id);
	
	//文章查询分页显示
	public List<ArticleSearchVo> listSearchResultByPage(Integer status, HttpServletRequest request, Model model,
            Integer pageNo, Integer pageSize, String s);
 
	//获得相关文章
	public List<ArticleVO> listArticleWithSameCategory(Integer status, Integer parentCategoryId,
            Integer childCategoryId, Integer limit);
	
	//获取访问量较多的文章
	public List<ArticleVO> listArticleByViewCount(Integer status, Integer limit);
	
	//获得上一篇文章
	public ArticleVO getAfterArticle(Integer status, Integer id);
	
	//获得下一篇文章
	public ArticleVO getPreArticle(Integer status, Integer id);
	
	//获得随机文章
	public List<ArticleVO> listRandomArticle(Integer status, Integer limit);
	
	//获得评论数较多的文章
	public List<ArticleVO> listArticleByCommentCount(Integer status, Integer limit);

	//添加文章
	public void insertArticle(Article article);

	//获得某个分类的文章数
	public Integer countArticleWithCategory(Integer status, Integer id);

	//获得某个标签的文章数
	public Integer countArticleWithTag(Integer status, Integer id);

	//更新文章的评论数
	public void updateCommentCount(Integer articleId);

	//获得最后更新记录
	public ArticleVO getLastUpdateArticle();
}
